package com.ruoyi.order.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.order.domain.TechnicianItemOrder;
import com.ruoyi.order.mapper.TechnicianItemOrderMapper;
import com.ruoyi.order.service.ITechnicianItemOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 常规订单Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-09
 */
@Service
public class TechnicianItemOrderServiceImpl implements ITechnicianItemOrderService {
    @Autowired
    private TechnicianItemOrderMapper technicianItemOrderMapper;

    /**
     * 查询常规订单
     *
     * @param id 常规订单主键
     * @return 常规订单
     */
    @Override
    public TechnicianItemOrder selectTechnicianItemOrderById(Long id) {
        return technicianItemOrderMapper.selectTechnicianItemOrderById(id);
    }

    /**
     * 查询常规订单列表
     *
     * @param technicianItemOrder 常规订单
     * @return 常规订单
     */
    @Override
    public List<TechnicianItemOrder> selectTechnicianItemOrderList(TechnicianItemOrder technicianItemOrder) {
        return technicianItemOrderMapper.selectTechnicianItemOrderList(technicianItemOrder);
    }

    /**
     * 新增常规订单
     *
     * @param technicianItemOrder 常规订单
     * @return 结果
     */
    @Override
    public int insertTechnicianItemOrder(TechnicianItemOrder technicianItemOrder) {
        technicianItemOrder.setCreateTime(DateUtils.getNowDate());
        return technicianItemOrderMapper.insertTechnicianItemOrder(technicianItemOrder);
    }

    /**
     * 修改常规订单
     *
     * @param technicianItemOrder 常规订单
     * @return 结果
     */
    @Override
    public int updateTechnicianItemOrder(TechnicianItemOrder technicianItemOrder) {
        technicianItemOrder.setUpdateTime(DateUtils.getNowDate());
        return technicianItemOrderMapper.updateTechnicianItemOrder(technicianItemOrder);
    }

    /**
     * 批量删除常规订单
     *
     * @param ids 需要删除的常规订单主键
     * @return 结果
     */
    @Override
    public int deleteTechnicianItemOrderByIds(Long[] ids) {
        return technicianItemOrderMapper.deleteTechnicianItemOrderByIds(ids);
    }

    /**
     * 删除常规订单信息
     *
     * @param id 常规订单主键
     * @return 结果
     */
    @Override
    public int deleteTechnicianItemOrderById(Long id) {
        return technicianItemOrderMapper.deleteTechnicianItemOrderById(id);
    }
}
